<!--
 * @Author: your name
 * @Date: 2021-09-10 09:53:14
 * @LastEditTime: 2021-09-10 14:14:32
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \briup\6-jQuery\day01\5-jquery文档加载完成.html
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/jquery.js"></script>
</head>

<body>
    <button>按钮</button>
</body>
<script>
    //$(document).ready(function(){})文档就绪事件，
    //等DOM结构解析完就执行，不需要等全部元素执行完
    //window.onload 是要等全部元素加载完毕执行
    //$(document).ready(function(){})可以简写成$(function(){})
    $(document).ready(
            function() {
                var btn = $("button");
                console.log(btn);
            }
        )
        //匿名函数 等同于上面的文档就绪事件
    $(function() {
        var btn = $("button");
        console.log(btn);
    });
</script>

</html>